// 功能: 从文件中读出字符(read file1)
void read()
{
int i, start, num, inum;
if(argc != 2)
{
printf("command read must have one args. \n");
return;
}
for(i = 0; i < FILENUM; i++)
if((file_array[i].inum > 0) &&
!strcmp(file_array[i].file_name,argv[1]))
break;
if(i == FILENUM)
{
printf("Open %s first.\n", argv[1]);
return ;
}
else if(file_array[i].mode == 2)
{
printf("Can't read %s.\n", argv[1]);
return ;
}
inum = file_array[i].inum;
printf("The length of %s:%d.\n", argv[1], inode_array[inum].length);
if(inode_array[inum].length > 0)
{
printf("The start position:");
	 scanf("%d", &start);
	 gets(temp);
  if((start<0)||(start>=inode_array[inum].length))
{
printf("Start position is wrong.\n");
return;
}
printf("The bytes you want to read:");
scanf("%d", &num);
gets(temp);
if(num <= 0)
{
printf("The num you want to read is wrong.\n");
return ;
}
read_blk(inum);
for(i = 0; (i < num) && (temp[i] != '\0'); i++)
printf("%c", temp[start+i]);
printf("\n");
}
}